package leesoft.intg.plugins;

import java.util.Map;

import leesoft.configuration.core.RuntimeContext;
import leesoft.configuration.interfaces.AfterPlugin;

public class SampleFieldValueChange extends AfterPlugin {



	@Override
	public void execute(Map rsMap) {
		String fieldName=(String)parameters.get("__fieldName__");
		String newString="";
		newString=(String)rsMap.get(fieldName);
		if(parameters.get(newString)!=null){//map exist
			newString=(String)parameters.get(newString);
			rsMap.put(fieldName, newString);
		}else{
			if(parameters.get("__default__")!=null){
				String value=(String)parameters.get("__default__");
				if(value.equals("__NULL__"))
					rsMap.put(fieldName, null);
				else
					rsMap.put(fieldName, value);
			}
		}
	}

}
